package com.cfg;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

@Service
public class EnvironmentService {

    private final Environment environment;

    @Autowired
    public EnvironmentService(Environment environment) {
        this.environment = environment;
    }

    public Environment getEnvironment() {
        return environment;
    }
    public void printConfig() {
        String fallbackMethod = environment.getProperty("circuit.breaker.method1.fallbackMethod");
        System.out.println("Fallback Method: " + fallbackMethod);
    }
}
